package com.exartisan.thanhdoanhn;

import android.os.Bundle;

import com.actionbarsherlock.app.SherlockFragmentActivity;
import com.exartisan.bean.Event;
import com.exartisan.bean.Post;

public abstract class BaseActivity extends SherlockFragmentActivity {
	public static Event event;
	public static Post post;

	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setUpActionBar();
		initUI();
		initProcess();
	}


	/**
	 * initialize Views
	 */
	protected abstract void initUI();


	/**
	 * beginning actions of the Activity
	 */
	protected abstract void initProcess();

	/**
	 * Scan files from SDcard then read content of those.</br> Finally, save
	 * result of those processes into some collections.</br> Those are data of
	 * the application. Thus, write once, use the data everywhere.
	 */

	protected void setUpActionBar() {
		
	}


	public static Event getEvent() {
		return event;
	}


	public static void setEvent(Event event) {
		BaseActivity.event = event;
	}


	public static Post getPost() {
		return post;
	}


	public static void setPost(Post post) {
		BaseActivity.post = post;
	}
	
	public SherlockFragmentActivity getActivity(){
		return this;
	}
}
